import router from '@/router';
import {
	service,
	request
} from '../../../../api/service.js';

export default {
	namespaced: true,
	state: {
		// 用户信息
		isOpenTransfer: false
	},
	actions: {
		// MES/MESMaterialRequestOrder/GetMaterialDataList
		//加载物料信息
		async loadmaterialDataListHttp({
			dispatch
		}, {
			url='',
			type='',
			materialCodeOrName = '',
			projectdetailIdList=null,
			pageNumber = 1,
			pageSize = 10
		} = {}) {
			var response = await request({
				url: `${url}?
				materialCodeOrName=${materialCodeOrName}&
				projectdetailIdList=${projectdetailIdList}&
				pageNumber=${pageNumber}&
				pageSize=${pageSize}&
				type=${type}
				`,
				method: 'get'
			});
			return response;
		},

		async setIsOpenTransferFunc({
			state,
			commit
		}, {
			parmater = false
		} = {}) {
			commit('setIsOpenTransfer', parmater);
		}

	},
	// this.$store.commit
	mutations: {
		setIsOpenTransfer(state, isOpenTransfer) {
			state.isOpenTransfer = isOpenTransfer;
		}
	}
};
